<script lang="ts" setup>
import ProductBox from "../Common/ProductBox.vue";
import { ref } from "vue";
import type { Dayjs } from "dayjs";
type RangeValue = [Dayjs, Dayjs];

const value5 = ref<string>("Option1");
const value1 = ref<RangeValue>();
const value6 = ref<string>("");
const year = ref<Dayjs>();

const dataSource = [
  {
    key: "1",
    no: 2,
    apiType: "api",
    type: "xxx",
    income: "+100",
    outlay: "-100",
    bal: "200",
    time: "2020-04-05",
    desc: "xxxxx",
  },
];

const columns = [
  {
    title: "流水编号",
    dataIndex: "no",
    key: "no",
  },

  {
    title: "API类型",
    dataIndex: "apiType",
    key: "apiType",
  },
  {
    title: "类型",
    dataIndex: "type",
    key: "type",
  },
  {
    title: "收入(元)",
    dataIndex: "income",
    key: "income",
  },
  {
    title: "支出(元)",
    dataIndex: "outlay",
    key: "outlay",
  },
  {
    title: "余额(元)",
    dataIndex: "bal",
    key: "bal",
  },
  {
    title: "时间",
    dataIndex: "time",
    key: "time",
  },
  {
    title: "描述",
    dataIndex: "desc",
    key: "desc",
  },
  {
    title: "操作",
    dataIndex: "operation",
    key: "operation",
  },
];
</script>
<template>
  <div class="pr-5 pl-5">
    <ProductBox title="财务明细">
      <template #default>
        <div class="flex flex-wrap items-center">
          <div class="flex w-100 mb-5">
            <a-input-group compact>
              <div class="flex whitespace-nowrap">
                <a-select v-model:value="value5">
                  <a-select-option value="Option1">流水编号</a-select-option>
                </a-select>
                <a-input v-model:value="value6" style="width: 70%" />
              </div>
            </a-input-group>
          </div>
          <a-date-picker v-model:value="year" picker="year" class="mb-5" />
          <span class="w-5"></span>
          <div class="flex items-center mb-5">
            <a-range-picker v-model:value="value1" />
            <a-button type="text">
              <img src="/console/downloadIcon.png" alt="" class="w-5 h-5" />
            </a-button>
          </div>
        </div>
        <div class="m-5"></div>
        <a-table :scroll="{ x: 1000, }" :dataSource="dataSource" :columns="columns" />
      </template>
    </ProductBox>
  </div>
</template>
<style lang="scss" scoped></style>
